home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / web / spiderweb / patches / 007 < prev    next >
Encoding:
Text File  |  1989-08-22  |  7.2 KB  |  189 lines

  1. *** master/spider.web.old    Wed Aug 23 14:08:45 1989
  2. --- master/spider.web    Wed Aug 23 14:03:12 1989
  3. ***************
  4. *** 314,322 ****
  5.   
  6.   # If the macro facility worked right, 
  7.   we would use the following patterns to recognize items as they occur:
  8. ! #d cat_pattern = #=/[a-z][a-z_]*/#>
  9. ! #d trans_pattern = #=/<(([0-9]|[a-z][a-z_]*|"([^"]*\\")*[^"]*"|\*)-)*#>#&
  10. !                       #=([0-9]|[a-z][a-z_]*|"([^"]*\\")*[^"]*"|\*)>/#>
  11.   
  12.   # Here's where we swallow a translation and spit out the \.{WEAVE} code
  13.   to handle that translation.
  14. --- 314,322 ----
  15.   
  16.   # If the macro facility worked right, 
  17.   we would use the following patterns to recognize items as they occur:
  18. ! #d cat_pattern = #=/[a-zA-Z][a-zA-Z_]*/#>
  19. ! #d trans_pattern = #=/<(([0-9]|[a-zA-Z][a-zA-Z_]*|"([^"]*\\")*[^"]*"|\*)-)*#>#&
  20. !                       #=([0-9]|[a-zA-Z][a-zA-Z_]*|"([^"]*\\")*[^"]*"|\*)>/#>
  21.   
  22.   # Here's where we swallow a translation and spit out the \.{WEAVE} code
  23.   to handle that translation.
  24. ***************
  25. *** 341,347 ****
  26.       if (alternate ~ #=/^[0-9]$/#>) { ## digit
  27.           temp = sprintf("\tapp_str(\"%s\");\n",alternate)
  28.           outstring=outstring temp
  29. !     } else if (alternate ~ #=/^[a-z_]+$/#>) { ## key word
  30.           translation_keywords[alternate]=1 ## remember
  31.           temp = sprintf("\t%s(%s);\n",append_keyword,alternate) 
  32.   ##Call |app| or |small_app| depending whether we're reducing or creating scraps
  33. --- 341,347 ----
  34.       if (alternate ~ #=/^[0-9]$/#>) { ## digit
  35.           temp = sprintf("\tapp_str(\"%s\");\n",alternate)
  36.           outstring=outstring temp
  37. !     } else if (alternate ~ #=/^[a-zA-Z_]+$/#>) { ## key word
  38.           translation_keywords[alternate]=1 ## remember
  39.           temp = sprintf("\t%s(%s);\n",append_keyword,alternate) 
  40.   ##Call |app| or |small_app| depending whether we're reducing or creating scraps
  41. ***************
  42. *** 394,400 ****
  43.       if (alternate ~ #=/^[0-9]$/#>) { ## digit
  44.           print "Digit not allowed in restricted translation", wherestring
  45.           exitcode = -1
  46. !     } else if (alternate ~ #=/^[a-z_]+$/#>) { ## key word
  47.           print "Key word not allowed in restricted translation", wherestring
  48.           exitcode = -1
  49.       } else if (alternate ~ #=/^\"([^"]*\\\")*[^"]*\"$/#>) { ## string
  50. --- 394,400 ----
  51.       if (alternate ~ #=/^[0-9]$/#>) { ## digit
  52.           print "Digit not allowed in restricted translation", wherestring
  53.           exitcode = -1
  54. !     } else if (alternate ~ #=/^[a-zA-Z_]+$/#>) { ## key word
  55.           print "Key word not allowed in restricted translation", wherestring
  56.           exitcode = -1
  57.       } else if (alternate ~ #=/^\"([^"]*\\\")*[^"]*\"$/#>) { ## string
  58. ***************
  59. *** 576,582 ****
  60.           #<Process newline token description#>
  61.       } else    if ($2=="pseudo_semi") {
  62.           #<Process |pseudo_semi| token description#>
  63. !     } else if ($2 ~ #=/[a-zA-Z0-9]+/#>) { 
  64.           ## we recognize no other names
  65.           print "Error: unknown token species:", $2
  66.           #<Punt this command#>
  67. --- 576,582 ----
  68.           #<Process newline token description#>
  69.       } else    if ($2=="pseudo_semi") {
  70.           #<Process |pseudo_semi| token description#>
  71. !     } else if ($2 ~ #=/[a-zA-ZA-Z0-9]+/#>) { 
  72.           ## we recognize no other names
  73.           print "Error: unknown token species:", $2
  74.           #<Punt this command#>
  75. ***************
  76. *** 1200,1206 ****
  77.   that an item of ilk |fish_like| will get category |fish|.
  78.   
  79.   #<If no category is specified, invent a default if you can#>=
  80. !     if ($2 ~ #=/^[a-z_]+_like$/#> && $0 !~ #=/ category /#>) { 
  81.           ## give default category
  82.           this_category = substr($2,1,length($2)-5)
  83.           categories[this_category]=1
  84. --- 1200,1206 ----
  85.   that an item of ilk |fish_like| will get category |fish|.
  86.   
  87.   #<If no category is specified, invent a default if you can#>=
  88. !     if ($2 ~ #=/^[a-zA-Z_]+_like$/#> && $0 !~ #=/ category /#>) { 
  89.           ## give default category
  90.           this_category = substr($2,1,length($2)-5)
  91.           categories[this_category]=1
  92. ***************
  93. *** 1490,1498 ****
  94.   for (i=1; i<=NF; i++) {
  95.       if ($i ~ #=/<.*>/#>) { ##  should be |trans_pattern|
  96.           #<Process a translation in |$i|#>
  97. !     } else if ($i ~ #=/^!?[a-z_]+(\*\*?)?$/#>) { ## |cat_pattern|
  98.           #<Process a single category#>
  99. !     } else if ($i ~ #=/^!?\(([a-z_]+\|)*[a-z_]+\)(\*\*?)?$/#>){
  100.           #<Process a list of alternative categories#>
  101.       } else if ($i == "?") {
  102.           #<Process a category wild card#>
  103. --- 1490,1498 ----
  104.   for (i=1; i<=NF; i++) {
  105.       if ($i ~ #=/<.*>/#>) { ##  should be |trans_pattern|
  106.           #<Process a translation in |$i|#>
  107. !     } else if ($i ~ #=/^!?[a-zA-Z_]+(\*\*?)?$/#>) { ## |cat_pattern|
  108.           #<Process a single category#>
  109. !     } else if ($i ~ #=/^!?\(([a-zA-Z_]+\|)*[a-zA-Z_]+\)(\*\*?)?$/#>){
  110.           #<Process a list of alternative categories#>
  111.       } else if ($i == "?") {
  112.           #<Process a category wild card#>
  113. ***************
  114. *** 1632,1642 ****
  115.   
  116.   #<Strip stars from |$i| (if any) and add appropriate
  117.       translations to |trans[pos]|#>=
  118. ! if ($i ~ #=/^([a-z_]+|\(([a-z_]+\|)*[a-z_]+\))\*\*$/#>) { ## it's double-starred
  119.       temp = sprintf("\tmake_underlined(pp+%d);\n",pos-1)
  120.       trans[pos] = trans[pos] temp
  121.       $i = substr($i,1,length($i)-2)
  122. ! } else if ($i ~ #=/^([a-z_]+|\(([a-z_]+\|)*[a-z_]+\))\*$/#>) { ## it's starred
  123.       temp = sprintf("\tmake_underlined(pp+%d);\n",pos-1)
  124.       trans[pos] = trans[pos] temp
  125.       $i = substr($i,1,length($i)-1)
  126. --- 1632,1642 ----
  127.   
  128.   #<Strip stars from |$i| (if any) and add appropriate
  129.       translations to |trans[pos]|#>=
  130. ! if ($i ~ #=/^([a-zA-Z_]+|\(([a-zA-Z_]+\|)*[a-zA-Z_]+\))\*\*$/#>) { ## it's double-starred
  131.       temp = sprintf("\tmake_underlined(pp+%d);\n",pos-1)
  132.       trans[pos] = trans[pos] temp
  133.       $i = substr($i,1,length($i)-2)
  134. ! } else if ($i ~ #=/^([a-zA-Z_]+|\(([a-zA-Z_]+\|)*[a-zA-Z_]+\))\*$/#>) { ## it's starred
  135.       temp = sprintf("\tmake_underlined(pp+%d);\n",pos-1)
  136.       trans[pos] = trans[pos] temp
  137.       $i = substr($i,1,length($i)-1)
  138. ***************
  139. *** 1751,1757 ****
  140.           targetcategory[prodnum]="Unnamed category"
  141.           temp = sprintf("(pp+%d)->cat", $i-1)
  142.           unnamed_cat[prodnum]=temp
  143. !     } else if ($i ~ #=/[a-z][a-z_]*/#>) { ## a category
  144.           targetcategory[prodnum]=$i
  145.           categories[$i]=1 ## remember this is a category
  146.       } else {
  147. --- 1751,1757 ----
  148.           targetcategory[prodnum]="Unnamed category"
  149.           temp = sprintf("(pp+%d)->cat", $i-1)
  150.           unnamed_cat[prodnum]=temp
  151. !     } else if ($i ~ #=/[a-zA-Z][a-zA-Z_]*/#>) { ## a category
  152.           targetcategory[prodnum]=$i
  153.           categories[$i]=1 ## remember this is a category
  154.       } else {
  155. ***************
  156. *** 1827,1833 ****
  157.   temp = field[pos]
  158.   tempa = substr(temp,1,1)
  159.   if (tempa != "!") {    
  160. !     if (temp ~ #=/^\(([a-z_]+\|)*[a-z_]+\)(\*\*?)?$/#>) {
  161.           ## list of alternatives
  162.           #<Remove trailing stars from |temp|#>
  163.           temp = substr(temp,2,length(temp)-2)
  164. --- 1827,1833 ----
  165.   temp = field[pos]
  166.   tempa = substr(temp,1,1)
  167.   if (tempa != "!") {    
  168. !     if (temp ~ #=/^\(([a-zA-Z_]+\|)*[a-zA-Z_]+\)(\*\*?)?$/#>) {
  169.           ## list of alternatives
  170.           #<Remove trailing stars from |temp|#>
  171.           temp = substr(temp,2,length(temp)-2)
  172. ***************
  173. *** 1836,1842 ****
  174.               alternate = tok[j]
  175.               reduced[alternate]=1
  176.               }
  177. !     } else if (temp ~ #=/^[a-z_]+(\*\*?)?$/#>) {
  178.           #<Remove trailing stars from |temp|#>
  179.           reduced[temp]=1
  180.       } else if (temp != "?") {
  181. --- 1836,1842 ----
  182.               alternate = tok[j]
  183.               reduced[alternate]=1
  184.               }
  185. !     } else if (temp ~ #=/^[a-zA-Z_]+(\*\*?)?$/#>) {
  186.           #<Remove trailing stars from |temp|#>
  187.           reduced[temp]=1
  188.       } else if (temp != "?") {
  189.